package cn.tedu.boot32.mapper;

import cn.tedu.boot32.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    //如果返回值为一个对象 而非list集合 要求查询回来的结果必须是0条或一条
    //如果大于1就要用list集合去保存 通过集合长度进行判断
    @Select("select * from user where username=#{username}")
    User selectByUsername(String username);
    @Insert("insert into user values(null,#{username},#{password},#{nick})")
    void insert(User user);

}
